package com.extend2;

public class Base {
    // 共有属性
    public int a = 100;
    protected int b = 200;
    int c = 300;
    private int d = 400;

    // Base构造器
    public Base() {
        System.out.println("Base无参构造器");
    }

    public Base(int a, int b){
        System.out.println("Base(int a, int b)构造器");
    }

    public Base(int a){
        System.out.println("Base(int a)构造器");
    }

    // 共有方法
    public void test100() {
        System.out.println("test100");
    }
    protected void test200() {
        System.out.println("test200");
    }
    void test300() {
        System.out.println("test300");
    }
    private void test400() {
        System.out.println("test400");
    }

    // 父类提供public公共方法，间接访问私有属性d
    public int getD() {
        return this.d;
    }
}
